package shape;

/**
 * Created by thoughtworks on 25/7/14.
 */
public class NamedDiamond extends Shape {

    private int height;
    private String name;

    public NamedDiamond(int height,String name) {
        this.height = height;
        this.name = name;
    }

    @Override
    public String[] exportString() {
        String[] bitmap = new Diamond(height).exportString();
        bitmap[height - 1] = "";
        int i;
        for(i = 0;i < (height * 2 + 1 - name.length()) / 2 + 1;i++)
            bitmap[height - 1] = bitmap[height - 1] + " ";
        bitmap[height - 1] = bitmap[height - 1] + name;
        return bitmap;
    }
}
